<template>
  <input type="text" placeholder="男朋友的名字" v-model.lazy="friend" />
</template>

<script>
export default {
  data() {
    return {
      friend: {
        name: '',
      },
    }
  },
  watch: {
    // friend(newValue, oldValue) {
    // console.log(newValue)
    // console.log(oldValue)
    // },
    friend: {
      handler(newValue, oldValue) {
        console.log(newValue)
        console.log(oldValue)
      },
      //首次执行一下
      deep: true,
      immediate: true,
    },
  },
}
</script>

<style></style>
